<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
  <head>
      <base th:href="${#request.getContextPath()}+'/'">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商城首页</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
      <link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
      <link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.css">
      <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript">
     
     $(document).ready(function(){
        
        var lb = document.getElementById("lunbo")
        var num=1;


        // 自动换图
        setInterval(function(){
            num++;
            if(num > 3){
                num = 1;     
            }
            if(num<1){
              num=3;
            }
            lb.src="../image/change"+num+".jpg"
        },2000)
        var left = document.getElementById("left")
        var right = document.getElementById("right")

        // 点击左箭头换图
        left.onclick=function(){
            num--;
            if(num <= 0){
                num = 3;     
            }
            lb.src="../image/change"+num+".jpg"
   
        }

        // 点击右键换箭头
        right.onclick=function(){
            num++;
            if(num >= 3){
                num = 1;     
            }
            lb.src="../image/change"+num+".jpg"
        }


        // 点击圆点换图
        var allLi = document.getElementsByTagName('ul')[0].getElementsByTagName("li");
        for(var i = 0 ; i < allLi.length ; i++){
            // 给每个li元素赋值，每循环一次，i+1;
            allLi[i].index = i;
            allLi[i].onclick=function(){
                // li的索引是从0开始的，所以要+1
                var num = this.index+1;
                lb.src="../image/change"+num+".jpg"
            }   
        }

    });
</script>
  <style type="text/css">
    *{margin: 0px;padding: 0px;}
    body{
      overflow: auto;
    }
    .thead{
      position: relative;
      height: 100px;
      width: 100%;
      background: #ebebeb;
      line-height: 100px;
      letter-spacing: 20px;
      font-size: 50px;
      text-align: center;
    }
    .tbody{
      margin: 0 auto;
      overflow:hidden;
      width: 1000px;
      height: 900px;
      /*background-color: green;*/
    }
    .tfoot{
      height: 80px;
      width: 100%;
      text-align: center;
      line-height: 80px;
      background-color: #ebebeb;
    }
    .load{
        position:relative;
        background-color: red;
        width: 100%;
        height: 40px;
       }
    .load_left{
      position: absolute;
      margin-left:500px; 
    } 
    .load_left ol{
      list-style-type: none;
      margin: 0px;
      padding: 0px;
    }
    .load_left li{
      display: inline-block;
      text-align: center;
      width: 100px;
      height: 40px;
      line-height: 40px;
    }
    .load_left li:hover{
      background-color: black;
    }
    .load_left li a{
      text-decoration: none;
      color:  #FFFFF0;
    }
    .load_right{
        position: absolute;
        right:60px;
    }
    .load_right ol{
        list-style: none;
        margin: 0px;
        padding: 0px;
    }
    .load_right ol li{
        display: inline-block;
        width: 80px;
        height: 40px;
        line-height: 40px;
    }
    .load_right ol li a{
        color:  #FFFFF0;
        text-decoration: none;
    }
    .load_right ol li a:hover{
        color: black;
        text-decoration: none;
    }
    .drop-down:hover .detail{
        display: block;
    }
    .detail{
        display: none;
        position: absolute;
    }
    .detail li{
        display: block;
        width: 50px;
        height: 40px;
        line-height: 40px;
        background-color: red;
        border: 1px solid black;
        text-align: center;
    }
    .searchOne{
        margin: 0 auto;
        width: 1000px;
        height: 70px;
        text-align: center;
    }
    #search_input{
        margin-top: 20px;
        border-radius: 5px;
        width: 700px;
        height: 35px;
    }
    #search_submit{
        width: 80px;
        height: 35px;
    }
    .fage{
        width: 1000px;
        height: 340px;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
    }
    .fage img{
        width: 1000px;
        height:340px;
    }
    .now-left{
        position: absolute;
        top: 150px;
        left: 20px;
        width: 20px;
        height: 50px;
    }
    .now-right{
        position: absolute;
        top: 150px;
        right:20px;
        width: 20px;height: 50px;
    }
    .ul_dian{
        position: absolute;
        top: 90%;
        left: 45%;

    }
    .ul_dian li{
        float: left;
        width: 30px;
    }
    .tbody p{
        padding: 3px;
        font-size: 15px;

    }
    .tbody p a{
        text-decoration: none;
    }
    .tbody hr{
        margin-top:0px;
        border-color: black;
    }
    .tbody li{
        display: inline-block;
        padding-right:11px;
    }
  </style>

  </head>

  <body>
  <div class="thead">
      <p>图书商城首页</p>
  </div>
  <div class="load">
      <ol class="load_left">
          <li><a href="user/toIndex">首页</a></li>
          <li><a href="book/queryByType?bookType=文学类">文学类</a></li>
          <li><a href="book/queryByType?bookType=惊恐悬疑类">惊恐悬疑类</a></li>
          <li><a href="book/queryByType?bookType=少儿类">少儿类</a></li>
          <li><a href="book/queryByType?bookType=科幻类">科幻类</a></li>
          <li><a href="book/queryByType?bookType=经管类">经管类</a></li>
          <li><a href="book/queryByType?bookType=编程类">编程类</a></li>
      </ol>
      <div class="load_right">
          <ol>
              <li><a href="login.html">登录,注册</a></li>
              <li class="drop-down">
                  <span>欢迎，你</span>
                  <ul class="detail">
                      <li><a href="user/own">个人信息</a></li>
                      <li><a href="shop/queryAllMyShop">我的购物车</a></li>
                  </ul>
              </li>

          </ol>
      </div>
  </div>
  <div class="searchOne">
      <form action="book/queryByBookName" method="post">
          <input type="text" name="searchMessage" placeholder="请输入搜索数据" id="search_input" required></input>
          <input type="submit" value="搜索" id="search_submit"></input>
      </form>
  </div>
    <div class="fage">
      <img src="../image/change1.jpg" alt="" style="z-index: -1;"id="lunbo">
      <i class='glyphicon glyphicon-chevron-left now-left' id="left"></i>
      <i class='glyphicon glyphicon-chevron-right now-right' id="right"></i>
        <ul class="ul_dian">
            <li class='glyphicon glyphicon-unchecked '></li>
            <li class='glyphicon glyphicon-unchecked '></li>
            <li class='glyphicon glyphicon-unchecked '></li>
        </ul>
    </div>
    <div class="tbody">
      <p>推荐书籍 <a href="#">更多</a></p><hr>
      <ul>
        <li>
          <img src="../image/编程类/c语言.jpg" style="width: 150px;height:100px; " alt="">
          <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">30元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
          <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
      </ul>
       <ul>
       <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
           <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
      </ul>
     <p>经典书籍 <a href="#">更多</a></p><hr>
      <ul>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
      </ul>
       <ul>
       <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
           <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
        <li>
          <img src="../image/book2_300x300.jpg" style="width: 150px;height:100px; " alt="">
            <p ><a href='book/queryBookByIdOne?bookId=1'>c语言</a></p>
          <p style="color: red;font-size: 25px;margin: 0px;">120元</p>
        </li>
      </ul>
    </div>
    <div class="tfoot">
      <span style="text-align: center;font-size: 20px;">Copyright © 2021 from Wangcheng. All rights reserved.</span>
    </div>
</body>
</html>